﻿using DAL;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;
using System.Data;



namespace BLL
{
   public class SEOutStockBLL
    {
       private SEOutStockDAL SEODal = new SEOutStockDAL();
       /// <summary>
       /// 获取出库列表
       /// </summary>
       /// <returns></returns>
       public DataSet GetSEOutStockList()
       {
           return SEODal.GetSEOutStockList();
       }
       //获取销售出库明细
       public DataSet GetSEOutStockDetail(string FBillNo, string PosiID)
       {
           return SEODal.GetSEOutStockDetail(FBillNo, PosiID);
       }
       //获取条码信息 
       public bool GetSEOutStockCode(string PkgsBarCode, out string HelperCode, out string PlaceBarCode, out string PlaceName, out string Floor, out string Fsku, out string StickLen, out string Stick, out string FQty, out string PkgsIsRegular)
       {
           return SEODal.GetSEOutStockCode(PkgsBarCode, out  HelperCode, out  PlaceBarCode, out  PlaceName, out  Floor, out  Fsku, out  StickLen, out  Stick, out  FQty, out  PkgsIsRegular);
           //
       }
       /// <summary>
       /// 查询扫码数量
       /// </summary>
       /// <param name="FBillNo"></param>
       /// <returns></returns>
       public int GetScanQty(string FBillNo)
      {
          return SEODal.GetScanQty(FBillNo); 
      }
       /// <summary>
       /// 查询未扫码数量
       /// </summary>
       /// <param name="FBillNo"></param>
       /// <returns></returns>
       public int SelScanQty(string FBillNo)
       {
           return SEODal.SelScanQty(FBillNo);
       }
       //更新条码
       public int UpdateSEOutStock(string PkgsBarCode, string FBillNO, string HelperCode, string FSku, string StickLen, string FQty, string PkgsIsRegular, string ID, string plname)
       {
           return SEODal.UpdateSEOutStock(PkgsBarCode, FBillNO, HelperCode, FSku, StickLen, FQty, PkgsIsRegular, ID, plname);
       }
       //排序
       public int Updatepx(string PkgsBarCode, string FBillNO)
       { 
           return SEODal.Updatepx( PkgsBarCode,  FBillNO);
       }
       //增加条码
       public int InsertSEOutStock(string PkgsBarCode, string oldPkgsBarCode, string DFInterID, string DFEntryID, string FDetailID, string FBillNo, string FEntryID, string FSourceBillNo, string Fry, string HelperCode, string t_PkgsIsRegular, string ID)
      {
          return SEODal.InsertSEOutStock( PkgsBarCode,  oldPkgsBarCode, DFInterID, DFEntryID, FDetailID,  FBillNo, FEntryID, FSourceBillNo,  Fry, HelperCode, t_PkgsIsRegular, ID);
      }

      //将找不到的条码更新到t_SEOutStockDetail表中
      public int UpdateNotFindCode(string oldPkgsBarCode, string FBillNo, string username)
      {
          return SEODal.UpdateNotFindCode(oldPkgsBarCode, FBillNo, username);
      }
      //将消件条码更新到t_SEOutStockDetail表中
      public int UpdateTUIFindCode(string oldPkgsBarCode, string FBillNo, string username)
      {
          return SEODal.UpdateTUIFindCode(oldPkgsBarCode, FBillNo, username);
      }
       //往金蝶传输数据outoutout out
      public bool jdSEOoutStock(string FBillNo, string userid, out  string txt)
      {
          return SEODal.jdSEOoutStock(FBillNo, userid, out  txt);
      }
      //完成发货单,out string txt out 
      public bool FinishSEOoutStock(string FBillNo, string userid, out string txt)
       {
            bool lb_return = false;
            txt = "";
            return SEODal.FinishSEOoutStock(FBillNo, userid, out txt);          
       }
       //判断替换的条码是否为同一销售出库单
      public bool ISExist(string PkgsBarCode, string oldPkgsBarCode, string FBillNo)
       {
           return SEODal.ISExist( PkgsBarCode,  oldPkgsBarCode,  FBillNo);
       }
      }
}
